package com.xq.service.impl;

import com.xq.dao.PeopleDao;
import com.xq.pojo.People;
import com.xq.service.PeopleService;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author xq
 * @version 1.0
 * @date 2021/4/6 17:36
 * @description 人们业务接口实现类
 */
@Data
@Service // 注入到Ioc容器中，标识为业务服务层对象
public class PeopleServiceImpl implements PeopleService {

    @Autowired
    private PeopleDao peopleDao;

    @Override
    public Integer addPeople(People people) {
        return this.peopleDao.addPeople(people);
    }

    @Override
    public Integer updatePeople(People people) {
        return this.peopleDao.updatePeople(people);
    }

    @Override
    public Integer deletePeopleById(Integer id) {
        return this.peopleDao.deletePeopleById(id);
    }

    @Override
    public List<People> getAllPeople() {
        return this.peopleDao.getAllPeople();
    }

    @Override
    public People getPeopleById(Integer id) {
        return this.peopleDao.getPeopleById(id);
    }
}
